<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/spring.tld"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld"%>
<c:set var="BasePath" value="${pageContext.request.contextPath}"></c:set>
<c:set var="Plugins" value="${pageContext.request.contextPath}/res/plugins"></c:set>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>手续费设置</title>
<link href="${Plugins}/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="${Plugins}/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
<script src="${Plugins}/jquery/jquery-1.3.2.min.js"	type="text/javascript"></script>
<script src="${Plugins}/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script src="${Plugins}/jquery-validation/jquery.validate.min.js" type="text/javascript"></script>
<script src="${Plugins}/jquery-validation/jquery.metadata.js" type="text/javascript"></script>
<script src="${Plugins}/jquery-validation/messages_cn.js" type="text/javascript"></script>
<script src="${BasePath}/res/js/common/jquery.form.js" type="text/javascript"></script>
<script type="text/javascript" src="${BasePath}/res/js/ligerCommon.js"></script>
<script src="${BasePath}/res/js/common/jquery.validate.method.js" type="text/javascript"></script>
<script src="${Plugins}/datepicker/WdatePicker.js" type="text/javascript"></script>
<style type="text/css">
    body{ font-size:12px;}
    .l-table-edit {}
    .l-table-edit-td{ padding:4px;}
    .l-button-submit,.l-button-test{width:80px; float:left; margin-left:10px; padding-bottom:2px;}
    .l-verify-tip{ left:230px; top:120px;}
    .p-tab .s-lab{font-size:12px;font-family:"微软雅黑",​"宋体",​Arial,​sans-serif;}
	input.l-textarea{width:170px;height:20px;font-size:12px;}
	 .navbar {
		height: 20px;
		border-bottom: #E6E6E6 solid 1px;
		line-height: 20px;
	}
</style>
</head>
<body style="padding:10px">
<div class="navbar">
		<span>您当前的位置：</span>
		基础数据管理 &gt;物流商结算设置&gt;
		手续费设置
		
</div>
<form name="form1" method="post" action="setAgencyAndFare.do" id="form1">
<br>
<div id="">
<table cellpadding="0" cellspacing="0" class="l-table-edit p-tab" >
<input name="settleType" id="settleType"  type="hidden" value="${settleType}">
    <input name="code" id="code"  type="hidden" value="${code}">
    <input name="settleinfoCode" id="settleinfoCode"  type="hidden" value="${settleinfoCode}">
    <tr>
        <td align="right" class="l-table-edit-td s-lab"><font  color="red">*</font>每单手续费比例:</td>
        <td align="left" class="l-table-edit-td s-lab"><input name="poundage"  type="text" class="l-textarea" maxlength="3" id="poundage" value="${LogisticsSettle.poundage}"  validate="{required:true,hundredInteger:true}" />%</td>
        <td align="left"></td>
    </tr>
</table>
</div>

<input type="submit" value="保存" id="Button1" class="l-button l-button-submit" /> 
<input type="button" value="取消" name="tests"  id="tests" onclick="javascript:closeList()" class="l-button l-button-test" />
</form>
<div style="display:none">
<!--  数据统计代码 --></div>

<script type="text/javascript">

     jQuery.validator.addMethod("hundredInteger", function(value, element) {
	      return this.optional(element) || /^(?:\d?\d|100)$/.test(value);
      }, "只允许输入0-100的整数");

    $(function ()
		{
			//validate
		    $.metadata.setType("attr", "validate");
		    var v = $("form").validate({
		    	
		       	rules: {
		    		"poundage": {required: true,hundredInteger:true}
		    		
		    	},
		    	messages: {
		    		"poundage": {
		    			required: "该字段不能为空",
		    			hundredInteger: "只允许输入0-100的整数"
		    		}
		    	},
		    	
		        errorPlacement: function (lable, element)
		        {
		        	lable.ligerHideTip();
		            if (element.hasClass("l-textarea"))
		            {
		                element.ligerTip({ content: lable.html(), target: element[0] }); 
		            }
		            else if (element.hasClass("l-text-field"))
		            {
		                element.parent().ligerTip({ content: lable.html(), target: element[0] });
		            }
		            else
		            {
		                lable.appendTo(element.parents("td:first").next("td"));
		            }
		        }
		    ,
		        success: function (lable)
		        {
		            lable.ligerHideTip();
		            lable.remove();
		        },
		        submitHandler:function()
		        {
		            $("form .l-text,.l-textarea").ligerHideTip();
		            var options = {
		            		type: 'POST',
		            		beforeSend: function(){
		            			$("#form1").find(":submit,:button").attr("disabled", true);
		            		},
		            		success: function(data){
		            			if(data=="success") {
		            				var s=window.parent.$.ligerDialog.success("设置成功","提示",function () {
		            	        		parent.window.location.href = '../../base/logisticsManageController/toPageFinderLogisticInfo.do';
		            	        		});
		            	        		$(s.dialog.winbtns).remove();
		            	        		} else {
		            	        		  window.parent.$.ligerDialog.error("设置失败");
		            	        		}
		            	      	}	
		            	}, $form1 = $("#form1");
		           $form1.ajaxSubmit(options);
		             return false;
		        }
		    });
		}); 
// 取消
function closeList(){
	parent.window.location.href = '../../base/logisticsManageController/toPageFinderLogisticInfo.do';
 }
</script>
</body>
</html>